package com.example.demo.study.aop;

import org.apache.naming.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class AppTest {
    public static void main(String[] args) {
        ApplicationContext context=new AnnotationConfigApplicationContext(AppConfig.class);
        Boy boy=context.getBean("boy",Boy.class);
        Girl girl=context.getBean("girl",Girl.class);
//        boy.buy();
//        girl.buy();
        boy.gift(3000);
        girl.gift(1000);
    }
}
